import { IFeidaoAiBrowserComponent } from '@feidao/web/interfaces';
import read_text from "@feidao/web/atom/browser/file/read-text";
import nodejs from '@feidao/web/atom/browser/msg/nodejs';
import { send_msg as url } from "../../atom-web/config";

export default async function a002(fd: IFeidaoAiBrowserComponent, ...args: any[]) {
	// todo
	const input = fd.data.node.querySelector<HTMLInputElement>('[data-feidao-id="file-id"]');
	const str = await read_text(input, 'utf-8');
	const d = await nodejs(url, 'import-csv', { str }, false, false);
	console.log(d);
}
